﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Color x:Key="TxtBackground" R="#57" G="#00" B="#26" A="#FF" />
    <Color x:Key="TxtForeground" R="#FF" G="#F6" B="#D9" A="#FF" />
    <Color x:Key="HighBackground" R="#87" G="#00" B="#56" A="#FF" />
    <Color x:Key="LowBackground" R="#29" G="#00" B="#13" A="#FF"/>
    <Color x:Key="GlyphColor" R="#E8" G="#D9" B="#AC" A="#FF" />
    <Color x:Key="DisabledForegroundColor" R="#70" G="#5B" B="#35" A="#FF" />
    <Color x:Key="DisabledBackgroundColor" R="#87" G="#00" B="#56" A="#FF" />

    <Style x:Key="ButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle 
                            Margin="2"
                            StrokeThickness="1"
                            Stroke="#60000000"
                            StrokeDashArray="1 2"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Fill Brushes -->

    <!-- Normal Brush : #FFF #CCC -->
    <LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="1,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <!--<GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#CCC" Offset="1.0"/>-->
                <GradientStop Color="#CCFFFFFF" Offset="0.0" />
                <GradientStop Color="#7F000000" Offset="1.0" />
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <!-- Horizontal Normal Brush : #FFF #CCC-->
    <LinearGradientBrush x:Key="HorizontalNormalBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#CCC" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <!-- Light Brush : #FFF #EEE-->
    <LinearGradientBrush x:Key="LightBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#EEE" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <!-- Horizontal Light Brush : #FFF #EEE -->
    <LinearGradientBrush x:Key="HorizontalLightBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#EEE" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <!-- Dark Brush : #FFF #AAA-->
    <LinearGradientBrush x:Key="DarkBrush" StartPoint="0,0" EndPoint="1,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <!--<GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#AAA" Offset="1.0"/>-->
                <GradientStop Color="#7F000000" Offset="0.0" />
                <GradientStop Color="#CCFFFFFF" Offset="1.0" />
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>


    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />

    <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="{StaticResource LowBackground}"  />

    <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />

    <SolidColorBrush x:Key="SelectedBackgroundBrush" Color="#DDD" />
    
    <SolidColorBrush x:Key="NormalBackgroundBrush" Color="{StaticResource HighBackground}" />

    <!-- Border Brushes -->

    <!-- Normal Border Brush : #CCC #444 -->
    <LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#CCC" Offset="0.0"/>
                <GradientStop Color="#444" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <!-- Horizontal Normal Border Brush : #CCC #444 -->
    <LinearGradientBrush x:Key="HorizontalNormalBorderBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#CCC" Offset="0.0"/>
                <GradientStop Color="#444" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <!-- Defaulted Border Brush : #777 #000 -->
    <LinearGradientBrush x:Key="DefaultedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#777" Offset="0.0"/>
                <GradientStop Color="#000" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />

    <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />

    <SolidColorBrush x:Key="LightBorderBrush" Color="#AAA" />

    <!-- Miscellaneous Brushes -->
    <SolidColorBrush x:Key="GlyphBrush" Color="#444" />

    <SolidColorBrush x:Key="LightColorBrush" Color="#DDD" />


    <!-- Button Template -->

    <Style x:Key="RefreshButtonStyle" TargetType="Button" BasedOn="{StaticResource Base}" >
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
        <Setter Property="MinHeight" Value="21" />
        <Setter Property="MinWidth" Value="21" />
        <Setter Property="Background" Value="{StaticResource NormalBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="Black" />
        <Setter Property="BorderThickness" Value="1" />

        <Setter Property="ContentTemplate" >
            <Setter.Value>
                <DataTemplate>
                    <Border>
                        <Image Source="112_RefreshArrow_Green_24x24_72.png" Width="24" />
                    </Border>
                </DataTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border 
                        Name="Border"
                        CornerRadius="5" 
                        BorderThickness="{TemplateBinding BorderThickness}" 
                        Background="{TemplateBinding Background}" 
                        BorderBrush="{TemplateBinding BorderBrush}">

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition To="MouseOver" GeneratedDuration="0:0:0" />
                                    <VisualTransition To="Pressed" GeneratedDuration="0:0:0" />
                                    <VisualTransition To="Disabled" GeneratedDuration="0:0:0" />
                                    <VisualTransition From="Disabled" To="Normal" GeneratedDuration="0:0:0" />
                                </VisualStateGroup.Transitions>
                                
                                <VisualState Name="Normal" />
                                
                                <VisualState Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation To="{StaticResource TxtForeground}" Duration="0:0:0.5"
                                                        Storyboard.TargetName="Border"
                                                        Storyboard.TargetProperty="Background.Color" />
                                                        
                                    </Storyboard>
                                </VisualState>
                                
                                <VisualState Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation To="{StaticResource TxtBackground}" Duration="0:0:0.1"
                                                        Storyboard.TargetName="Border"
                                                        Storyboard.TargetProperty="Background.Color" />
                                    </Storyboard>
                                </VisualState>
                                
                                <VisualState Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimation To="{StaticResource LowBackground}" Duration="0:0:0.5"
                                                        Storyboard.TargetName="Border"
                                                        Storyboard.TargetProperty="Background.Color" />
                                    </Storyboard>
                                </VisualState>
                                
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <ContentPresenter 
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            RecognizesAccessKey="True"/>
                    </Border>
                    
                    <!--<ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsDefaulted" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DarkBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>-->
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>


</ResourceDictionary>